import { http } from "@/utils/http";
import type { TableItem } from "../type";

export const queryMeasureList = (data?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("post", `/account/api/v1/publish/measure/queryMeasureList`, { data }, { headers: { noLoading: true } }, cb);
// 指标配置查询
export const queryIndicatorConfigList = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/operation/api/v1/indicator/query/all`, { params }, { headers: { noLoading: true } }, cb);

// 新增指标配置
export const addIndicatorConfig = (data?: object | undefined, cb?: (err: any) => any) =>
  http.request("post", `/operation/api/v1/indicator/add`, { data }, { headers: { noLoading: true } }, cb);

// 修改指标配置
export const updateIndicatorConfig = (data?: object | undefined, cb?: (err: any) => any) =>
  http.request("post", `/operation/api/v1/indicator/update`, { data }, { headers: { noLoading: true } }, cb);

// 删除指标配置
export const deleteIndicatorConfig = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request("DELETE", `/operation/api/v1/indicator/delete`, { params }, { headers: { noLoading: true } }, cb);

// 单个中心指标矩阵
export const queryIndicatorMatrix = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/operation/api/v1/indicator/query/algorithmMatrix`, { params }, { headers: { noLoading: true } }, cb);

// 查询所有算法矩阵关系-需要传入查询的具体科室类型classType（0-四科 1-水科）
export const queryAllIndicatorMatrix = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/operation/api/v1/indicator/query/all/algorithmMatrix`, { params }, { headers: { noLoading: true } }, cb);

export const queryAllIndicatorMatrixV2 = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/operation/api/v1/indicator/query/all/algorithmMatrixV2`, { params }, { headers: { noLoading: true } }, cb);
//水科获取中心指标列表
export const queryqueryAllCenterIds = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/operation/api/v1/indicator/query/queryAllCenterIds`, { params }, { headers: { noLoading: true } }, cb);
//中心id获得矩阵
export const queryalgorithmMatrix = (params?: object | undefined, cb?: (err: any) => any) =>
  http.request<Array<TableItem>>("get", `/operation/api/v1/indicator/query/algorithmMatrix`, { params }, { headers: { noLoading: true } }, cb);
